//
//  DeviceVersion.m
//  CarLife
//
//  Created by yu on 2020/7/15.
//  Copyright © 2020 jpas. All rights reserved.
//

#import "DeviceVersion.h"

#import <sys/utsname.h>

@implementation DeviceVersion

+ (NSString *)deviceVersion
{
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString *deviceModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    PPLog(@"%@",deviceModel);
    
//    if ([deviceModel isEqualToString:@"iPhone1,1"])  return @"iPhone 1G";
//    if ([deviceModel isEqualToString:@"iPhone1,2"])  return @"iPhone 3G";
//    if ([deviceModel isEqualToString:@"iPhone2,1"])  return @"iPhone 3GS";
//    if ([deviceModel isEqualToString:@"iPhone3,1"])  return @"iPhone 4";
//    if ([deviceModel isEqualToString:@"iPhone3,2"])  return @"Verizon iPhone 4";
//    if ([deviceModel isEqualToString:@"iPhone4,1"])  return @"iPhone 4S";
//    if ([deviceModel isEqualToString:@"iPhone5,1"])  return @"iPhone 5";
//    if ([deviceModel isEqualToString:@"iPhone5,2"])  return @"iPhone 5";
//    if ([deviceModel isEqualToString:@"iPhone5,3"])  return @"iPhone 5C";
//    if ([deviceModel isEqualToString:@"iPhone5,4"])  return @"iPhone 5C";
//    if ([deviceModel isEqualToString:@"iPhone6,1"])  return @"iPhone 5S";
//    if ([deviceModel isEqualToString:@"iPhone6,2"])  return @"iPhone 5S";
//    if ([deviceModel isEqualToString:@"iPhone7,1"])  return @"iPhone 6 Plus";
//    if ([deviceModel isEqualToString:@"iPhone7,2"])  return @"iPhone 6";
//    if ([deviceModel isEqualToString:@"iPhone8,1"])  return @"iPhone 6s";
//    if ([deviceModel isEqualToString:@"iPhone8,2"])  return @"iPhone 6s Plus";
//    if ([deviceModel isEqualToString:@"iPhone8,4"])  return @"iPhone SE";
//    if ([deviceModel isEqualToString:@"iPhone9,1"])  return @"iPhone 7";
//    if ([deviceModel isEqualToString:@"iPhone9,2"])  return @"iPhone 7 Plus";
//    if ([deviceModel isEqualToString:@"iPhone10,1"]) return @"iPhone 8";
//    if ([deviceModel isEqualToString:@"iPhone10,4"]) return @"iPhone 8";
//    if ([deviceModel isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus";
//    if ([deviceModel isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";
//    if ([deviceModel isEqualToString:@"iPhone10,3"]) return @"iPhone X";
//    if ([deviceModel isEqualToString:@"iPhone10,6"]) return @"iPhone X";
//    if ([deviceModel isEqualToString:@"iPhone11,8"]) return @"iPhone XR";
//    if ([deviceModel isEqualToString:@"iPhone11,2"]) return @"iPhone XS";
//    if ([deviceModel isEqualToString:@"iPhone11,4"]) return @"iPhone XS Max";
//    if ([deviceModel isEqualToString:@"iPhone11,6"]) return @"iPhone XS Max";
//    if ([deviceModel isEqualToString:@"iPhone12,1"]) return @"iPhone 11";
//    if ([deviceModel isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro";
//    if ([deviceModel isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max";
//    if ([deviceModel isEqualToString:@"i386"])       return @"iPhone Simulator";
//    if ([deviceModel isEqualToString:@"x86_64"])     return @"iPhone Simulator";
    
    return deviceModel;
}

@end
